package com.anycl.design.behavioral.strategy;

import java.util.Comparator;
import java.util.TreeSet;

public class TreeSetTest {

    public static void main(String[] args) {
        TreeSet<String> treeSet = new TreeSet<>(new Comparator<String>() {
            @Override
            public int compare(String o1, String o2) {
                return o2.compareTo(o1);
            }
        });
        treeSet.add("Java");
        treeSet.add("MySQL");
        treeSet.add("python");
        treeSet.add("hello");
        treeSet.add("Hello");

        for (String s: treeSet)
            System.out.println(s);
    }
}
